package com.zml.cruddemo.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zml.cruddemo.dao.UserMapper;
import com.zml.cruddemo.entity.User;
import com.zml.cruddemo.service.UserService;

@Service
public class UserServiceImpl implements UserService {
	@Autowired
	private UserMapper userMapper;

	@Override
	public User getById(Integer id) {
		return this.userMapper.getById(id);
	}

	@Override
	public List<User> getList(Map<String, Object> map) {
		return this.userMapper.getList(map);
	}

	@Override
	public int insert(User user) {
		return this.userMapper.insert(user);
	}

	@Override
	public void deleteUserById(int id) {
		this.userMapper.deleteUserById(id);
	}

	@Override
	public void updateUser(User currentUser) {
		this.userMapper.updateUser(currentUser);
	}

	@Override
	public boolean isUserExist(User user) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void saveUser(User user) {
		this.userMapper.saveUser(user);
	}

	@Override
	public int getTotle() {
		return this.userMapper.getTotle();
	}

}
